package com.menu.system.service.impl;

import java.util.List;
import com.menu.common.utils.DateUtils;
import com.menu.system.domain.MenuProductsAttribute;
import com.menu.system.domain.MenuPublicattributeData;
import com.menu.system.mapper.MenuPublicattributeDataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.menu.system.mapper.MenuPublicattributeTypeMapper;
import com.menu.system.domain.MenuPublicattributeType;
import com.menu.system.service.IMenuPublicattributeTypeService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 产品共有属性类型Service业务层处理
 *
 * @author ruoyi
 * @date 2024-07-08
 */
@Service
public class MenuPublicattributeTypeServiceImpl implements IMenuPublicattributeTypeService
{
    @Autowired
    private MenuPublicattributeTypeMapper menuPublicattributeTypeMapper;
    @Autowired
    private MenuPublicattributeDataMapper menuPublicattributeDataMapper;
    /**
     * 查询产品共有属性类型
     *
     * @param publicattributeId 产品共有属性类型主键
     * @return 产品共有属性类型
     */
    @Override
    public MenuPublicattributeType selectMenuPublicattributeTypeByPublicattributeId(Long publicattributeId)
    {
        return menuPublicattributeTypeMapper.selectMenuPublicattributeTypeByPublicattributeId(publicattributeId);
    }

    /**
     * 查询产品共有属性类型列表
     *
     * @param menuPublicattributeType 产品共有属性类型
     * @return 产品共有属性类型
     */
    @Override
    public List<MenuPublicattributeType> selectMenuPublicattributeTypeList(MenuPublicattributeType menuPublicattributeType)
    {
        return menuPublicattributeTypeMapper.selectMenuPublicattributeTypeList(menuPublicattributeType);
    }

    /**
     * 新增产品共有属性类型
     *
     * @param menuPublicattributeType 产品共有属性类型
     * @return 结果
     */
    @Override
    @Transactional
    public int insertMenuPublicattributeType(MenuPublicattributeType menuPublicattributeType)
    {
        menuPublicattributeType.setCreateTime(DateUtils.getNowDate());



        return menuPublicattributeTypeMapper.insertMenuPublicattributeType(menuPublicattributeType);
    }

    /**
     * 修改产品共有属性类型
     *
     * @param menuPublicattributeType 产品共有属性类型
     * @return 结果
     */
    @Override
    @Transactional
    public int updateMenuPublicattributeType(MenuPublicattributeType menuPublicattributeType)
    {
        menuPublicattributeType.setUpdateTime(DateUtils.getNowDate());
        return menuPublicattributeTypeMapper.updateMenuPublicattributeType(menuPublicattributeType);
    }

    /**
     * 批量删除产品共有属性类型
     *
     * @param publicattributeIds 需要删除的产品共有属性类型主键
     * @return 结果
     */
    @Override
    public int deleteMenuPublicattributeTypeByPublicattributeIds(Long[] publicattributeIds)
    {
        return menuPublicattributeTypeMapper.deleteMenuPublicattributeTypeByPublicattributeIds(publicattributeIds);
    }

    /**
     * 删除产品共有属性类型信息
     *
     * @param publicattributeId 产品共有属性类型主键
     * @return 结果
     */
    @Override
    public int deleteMenuPublicattributeTypeByPublicattributeId(Long publicattributeId)
    {
        return menuPublicattributeTypeMapper.deleteMenuPublicattributeTypeByPublicattributeId(publicattributeId);
    }

    @Override
    public MenuPublicattributeType selectMenuPublicattributeTypeByType(String publicattributeType) {
        return menuPublicattributeTypeMapper.selectMenuPublicattributeTypeByType(publicattributeType);
    }


}
